><

Defining text macros



You define text macros by opening the desired source macro file with Adobe GoLive or a text editor and then typing, copying and pasting, or dragging the appropriate code. Text macro definitions must have the following basic format:

MacroName [Delimiter]MacroContent[Delimiter]

The first element in a macro definition is the macro name you enter in the respective editor before pressing Ctrl+M (Windows) or Command+M (Mac OS). With the exception of spaces and tabs, you can use any combination of characters for a macro name, but you should restrict yourself to using letters and digits. The three source code editors differ in what they regard as self-contained words. For example, using a dollar sign ($) in a macro name might work in the HTML Source editor but will fail in the JavaScript editor because this character is an integral part of the JavaScript syntax.

Separated by a space character, the second element specifies the content of the macro, that is, the text that is actually inserted after you type the macro name and press Ctrl+M (Windows) or Command+M (Mac OS). The content element must be enclosed in two identical or complementary delimiter characters. When you prompt Adobe GoLive to insert a text macro, the macro interpreter will regard the first character after the separating white space as the delimiter and look for an identical character to determine where the content ends.

For example, an image tag macro with basic attributes could look like this:

image «<img "src=../GIFS/???.GIF" width="20" height="20">»

You can also use a text macro to insert a string of formatted text. Here is an example:

webdesign $This Web Site was designed using <B>Adobe GoLive.</B>$


Working in HTML > Using text macros with source code editors > Defining text macros